﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Jzy;

namespace ECommerce.Model.Product
{
    public partial class ECProductInfo : EntityBase
    {
        private const string TABLE_NAME = "ECProduct";
        private const string INSERT_SQL = "insert into ECProduct ( [ID], [Name], [SmallImage], [AdImage], [Recommend], [CurrentPrice], [OldPrice], [VipPrice], [Size], [SalesVolume], [InputTime], [CreatorID], [CreatorName], [Type1], [Type2], [Type3], [Type4], [Type5], [Packag], [Material], [FlowerWord], [SendRange], [Remark], [AvgScore], [State]) values ( @ID, @Name, @SmallImage, @AdImage, @Recommend, @CurrentPrice, @OldPrice, @VipPrice, @Size, @SalesVolume, @InputTime, @CreatorID, @CreatorName, @Type1, @Type2, @Type3, @Type4, @Type5, @Packag, @Material, @FlowerWord, @SendRange, @Remark, @AvgScore, @State)";
        private const string UPDATE_SQL = "update ECProduct set  [ID] = @ID, [Name] = @Name, [SmallImage] = @SmallImage, [AdImage] = @AdImage, [Recommend] = @Recommend, [CurrentPrice] = @CurrentPrice, [OldPrice] = @OldPrice, [VipPrice] = @VipPrice, [Size] = @Size, [SalesVolume] = @SalesVolume, [InputTime] = @InputTime, [CreatorID] = @CreatorID, [CreatorName] = @CreatorName, [Type1] = @Type1, [Type2] = @Type2, [Type3] = @Type3, [Type4] = @Type4, [Type5] = @Type5, [Packag] = @Packag, [Material] = @Material, [FlowerWord] = @FlowerWord, [SendRange] = @SendRange, [Remark] = @Remark, [AvgScore] = @AvgScore, [State] = @State where ID = @ID";
        /// <summary>
        /// 
        /// </summary>
        public Int32 ID
        {
            get;
            set;
        }
        /// <summary>
        /// 名称
        /// </summary>
        public String Name
        {
            get;
            set;
        }
        /// <summary>
        /// 标题图片
        /// </summary>
        public String SmallImage
        {
            get;
            set;
        }
        /// <summary>
        /// 广告图片
        /// </summary>
        public String AdImage
        {
            get;
            set;
        }
        /// <summary>
        /// 是否推荐
        /// </summary>
        public Boolean Recommend
        {
            get;
            set;
        }
        /// <summary>
        /// 现价
        /// </summary>
        public Double CurrentPrice
        {
            get;
            set;
        }
        /// <summary>
        /// 原价
        /// </summary>
        public Double OldPrice
        {
            get;
            set;
        }
        /// <summary>
        /// Vip会员价
        /// </summary>
        public Double VipPrice
        {
            get;
            set;
        }
        /// <summary>
        /// 尺寸
        /// </summary>
        public String Size
        {
            get;
            set;
        }
        /// <summary>
        /// 销量
        /// </summary>
        public Int32 SalesVolume
        {
            get;
            set;
        }
        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime InputTime
        {
            get;
            set;
        }
        /// <summary>
        /// 创建人ID
        /// </summary>
        public Int32 CreatorID
        {
            get;
            set;
        }
        /// <summary>
        /// 创建人姓名
        /// </summary>
        public String CreatorName
        {
            get;
            set;
        }
        /// <summary>
        /// 品牌
        /// </summary>
        public Int32 Type1
        {
            get;
            set;
        }
        /// <summary>
        /// 用途
        /// </summary>
        public Int32 Type2
        {
            get;
            set;
        }
        /// <summary>
        /// 材料
        /// </summary>
        public Int32 Type3
        {
            get;
            set;
        }
        /// <summary>
        /// 对象
        /// </summary>
        public Int32 Type4
        {
            get;
            set;
        }
        /// <summary>
        /// 造型
        /// </summary>
        public Int32 Type5
        {
            get;
            set;
        }
        /// <summary>
        /// 包装
        /// </summary>
        public String Packag
        {
            get;
            set;
        }
        /// <summary>
        /// 材料
        /// </summary>
        public String Material
        {
            get;
            set;
        }
        /// <summary>
        /// 花语
        /// </summary>
        public String FlowerWord
        {
            get;
            set;
        }
        /// <summary>
        /// 配送范围
        /// </summary>
        public String SendRange
        {
            get;
            set;
        }
        /// <summary>
        /// 备注说明
        /// </summary>
        public String Remark
        {
            get;
            set;
        }
        /// <summary>
        /// 平均评分
        /// </summary>
        public Double AvgScore
        {
            get;
            set;
        }
        /// <summary>
        /// 状态
        /// </summary>
        public Int32 State
        {
            get;
            set;
        }
        public override void SetValue(string key, object value)
        {
            key = key.ToLower();
            switch (key)
            {
                case "id":
                    this.ID = (Int32)value;
                    break;
                case "name":
                    this.Name = (String)value;
                    break;
                case "smallimage":
                    this.SmallImage = (String)value;
                    break;
                case "adimage":
                    this.AdImage = (String)value;
                    break;
                case "recommend":
                    this.Recommend = (Boolean)value;
                    break;
                case "currentprice":
                    this.CurrentPrice = (Double)value;
                    break;
                case "oldprice":
                    this.OldPrice = (Double)value;
                    break;
                case "vipprice":
                    this.VipPrice = (Double)value;
                    break;
                case "size":
                    this.Size = (String)value;
                    break;
                case "salesvolume":
                    this.SalesVolume = (Int32)value;
                    break;
                case "inputtime":
                    this.InputTime = (DateTime)value;
                    break;
                case "creatorid":
                    this.CreatorID = (Int32)value;
                    break;
                case "creatorname":
                    this.CreatorName = (String)value;
                    break;
                case "type1":
                    this.Type1 = (Int32)value;
                    break;
                case "type2":
                    this.Type2 = (Int32)value;
                    break;
                case "type3":
                    this.Type3 = (Int32)value;
                    break;
                case "type4":
                    this.Type4 = (Int32)value;
                    break;
                case "type5":
                    this.Type5 = (Int32)value;
                    break;
                case "packag":
                    this.Packag = (String)value;
                    break;
                case "material":
                    this.Material = (String)value;
                    break;
                case "flowerword":
                    this.FlowerWord = (String)value;
                    break;
                case "sendrange":
                    this.SendRange = (String)value;
                    break;
                case "remark":
                    this.Remark = (String)value;
                    break;
                case "avgscore":
                    this.AvgScore = (Double)value;
                    break;
                case "state":
                    this.State = (Int32)value;
                    break;
            }
        }
    }


}
